package com.system

import groovy.transform.EqualsAndHashCode
import groovy.transform.ToString

@EqualsAndHashCode(includes='authority')
@ToString(includes='authority', includeNames=true, includePackage=false)
class RoleInfo implements Serializable {

	private static final long serialVersionUID = 1

	RoleInfo(String authority, String authorityName) {
		this.authority = authority
		this.authorityName = authorityName
	}

	String authority     //权限标识
	String authorityName //权限名称

	static constraints = {
		authority blank: false, unique: true
	}

	static mapping = {
		cache true
	}


	@Override
	public String toString() {
		"${authorityName}(${authority})"
	}
}
